<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/common/includes.jsp" %>

<html>

 <head>
    
    <title>报损统计表</title>
    <!-- import css and js -->
	<%@ include file="/common/meta.jsp" %>
		<script src="${ctx}/js/jsp/comm.js" type="text/javascript"></script>
	<script type="text/javascript">
		var basic_Url="${ctx}/yd/report";
		var basic_Title="";
		var show_Width=950;
		var show_Hight=400;
		function createSearch(){
			init(2,8,'140,140,140,140','25%');
			//第一行的数据
			addCommon(0,0,"lable","时间");
			addCommon(0,1,"date","pro.dctime");
			addCommon(0,2,"lable","开单公司");
			addCommon(0,3,"txtlike","pro.creategsname");
			addCommon(0,4,"lable","报损类型");
			addCommon(0,5,"selectEnum","pro.djlx","<option></option><option value='1'>入库</option><option value='2'>出库</option>");
		}
		function searchAP(){			
			multipleSearch("#table1",true,"",basic_Url+"/bslist.do");
		}
		
		function exportExcel(){
			var filtersStr = generateCondition();
			var path = basic_Url+"/bsexportExcel.do?filters="+filtersStr+"&_search=true";
		   	window.open(path,"_blank");
		}

		$(function(){
				var grid = $("#table1").ligerGrid({
			        columns: [
							{ display: '入库日期', name: 'rkrq', width: 100 ,render: function (item){
	  								var cdate=new Date(item.rkrq);
	  								return formatDate(cdate,"yyyy-MM-dd");
								}},
			                  { display: '品牌', name: 'brand', width: 150 },
			                  { display: '名称', name: 'name', width: 150 },
			                  { display: '采购编号', name: 'aktscode', width: 150 },
			                  { display: '开单公司', name: 'creategsname', width: 150 },
			                  { display: '仓库名称', name: 'whname', width: 100},
			                  { display: '入库数量', name: 'quantity', width: 120},
			                  { display: '损益数量', name: 'healthycount', width: 150},
			                  { display: '损益率', name: 'badcount', width: 150 }
			                      ],  usePager: true,pageSize:30,
			                      url : basic_Url+"/bslist.do",
			                      width: "100%", height:"98%", checkbox: false
			                  });
				$("#pageloading").hide();
				
		
		});
	</script>
  </head>
<body onLoad="createSearch()">
   <div id="layout1">
      <div position="top">
      		<div class="panelBar">
          	<ul class="toolBar">
				   <li><a class="export" onclick="exportExcel()"><span>导出Excel</span></a></li>
               </ul>
          </div>
          <div id="pageHeader" class="pageHeader">
               <div class="searchBar" id="multipleSearchDialog">
	                <table class="table" width="100%" id="searchHeader" >  
                        <tbody id="newbody">
                        </tbody>
 	                </table>
                    <div class="subBar">
			             <ul>
				             <li><div class="buttonActive"><div class="buttonContent"><button type="submit" id="btnSearch" onclick="searchAP()">查询</button></div></div></li>
				             <li><a class="button" onclick="clearSearch()"><span>重置</span></a></li>
			             </ul>
	                </div>
               </div>
          </div>
      </div>
      <div position="center" id="table1">
      </div>
      <div class="clear"></div>
   </div>
 
</body>
</html>